// 测试动态加载引擎

#include <openssl/engine.h>
#include <iostream>

extern "C" {    //必须导出为C符号

// 假设 ID 是 "fake"
static int bind_fake(ENGINE* e, const char* id) {

    if (!ENGINE_set_id(e, "fake") ||
        !ENGINE_set_name(e, "Fake Engine for Testing")) {
        return 0;
    }
    std::cout << "[fake_engine] bind_fake called\n";
    return 1;
}

// 必须用 OpenSSL 宏导出两个符号，dynamic 引擎加载时依赖
IMPLEMENT_DYNAMIC_BIND_FN(bind_fake)
IMPLEMENT_DYNAMIC_CHECK_FN()
}